﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	用户列表
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <table>
        <tr>
            <th>操作</th>
            <th>名称</th>
            <th>是否登录</th>
            <th>上次登录时间</th>
            <th>创建时间</th>
        </tr>
        <% foreach (MembershipUser user in Model)
           { %>
           <tr>
            <td>
                <% if(!Roles.GetRolesForUser(user.UserName).Contains("Administrator")){ %>
                    <%:Html.ActionLink("删除", "Delete", new{username=user.UserName}) %>
                <%} %>
            </td>
            <td><%:user.UserName %></td>
            <td><%:user.IsOnline %></td>
            <td><%:user.LastLoginDate %></td>
            <td><%:user.CreationDate %></td>
           </tr>
        <%} %>
    </table>
        <%: Html.ActionLink("修改密码", "ChangePassword", "Account")%><br /><br />

    <p>
        <%: Html.ActionLink("添加用户", "Register", "Account") %>|
        <%: Html.ActionLink("返回", "Index", "Manager") %>
    </p>

</asp:Content>
